package com.modemMgr.dao;

import com.modemMgr.util.DBAccessor;
import com.modemMgr.vo.Role;

public class RoleDAO extends BaseDAO{
	public RoleDAO(DBAccessor dbAccessor) {
		super(dbAccessor);
	}

	public Role getRoleByUserId(int userId) throws Exception
	{
		String sql = "select r.* from roles r, user_role_info u where r.is_valid = 1 and r.role_id = u.role_id and u.user_id = ?";
		return dbAccessor.queryObject(Role.class, sql, new Object[]{userId});
	}
}
